package com.mbmed.doctor.medadvice.service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.mbmed.doctor.commons.utils.ModelVo;
import com.mbmed.doctor.medadvice.bo.Vaf1Bo;

@Path("/vaf1")
@Component
public class Vaf1Service {

	@Autowired
	private Vaf1Bo vaf1Bo;
	
	@SuppressWarnings({ "unused", "rawtypes" })
	@GET
	@Path("/getVaf1s")
	@Produces(MediaType.APPLICATION_JSON)
	public Map getVaf1s(@QueryParam("vaa03")String vaa03, @QueryParam("bce01a")Integer bce01a) throws Exception {
		Map map = vaf1Bo.selectVaa1ByVaa03(vaa03);
		Integer vac01 = (Integer) map.get("vac01");
		Map paramMap = new HashMap();
		paramMap.put("vaf06", vac01);
		paramMap.put("vaf04", 1);
		paramMap.put("bce01a", bce01a);
		List list = vaf1Bo.selectVaf1sByParamMap(paramMap);
		Map result = new HashMap();
		result.put("info", map);
		result.put("list", list);
		return result;
	}
}
